using System;
using Kopernikus.Collections.Generic;

namespace Kopernikus.Parsing.GenericParsing
{
    public class ParsingException : Exception
    {
        private readonly Set<Symbol> m_expectedSymbols;
        private readonly object m_failToken;

        public ParsingException(object failToken, Set<Symbol> expectedSymbols)
        {
            m_failToken = failToken;
            m_expectedSymbols = expectedSymbols;
        }

        public override string Message
        {
            get { return string.Format("Expected {0} but saw {1}.", m_expectedSymbols, m_failToken); }
        }
    }
}